package org.simple.learning.sock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目名称：spring-boot-learning
 * 类名称：IndexController
 * 类描述：IndexController
 * 创建时间：2019/7/31
 *
 * @author guihuo   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
@RestController
@RequestMapping("/")
public class IndexController {

    @Autowired
    private SimpMessagingTemplate messagingTemplate;

    @GetMapping("/test")
    public String test() {
        messagingTemplate.convertAndSend("/notify/test", "eeeeeee");
        return "aaa";
    }

}
